write a query to join machine and repair table